<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false"%>
<%--
  Created by IntelliJ IDEA.
  User: xh
  Date: 2020/2/6
  Time: 13:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>

</head>
<body>
<!-- 登录框 -->
<div class="layui-row layui-main layui-hide" id="login-box">
    <div class="layui-col-xs12 l-login-area" >
        <div class="layui-tab layui-tab-brief l-login-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">欢迎登录</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <form class="layui-form" lay-filter="loginForm" id="loginForm" action="${APP_PATH}/doLogin"  method="post">
                        <div class="layui-form-item">
                            <input type="text" name="account" id="account" placeholder="手机号/邮箱/用户名" autocomplete="off" class="layui-input" lay-verify="required">
                        </div>
                        <div class="layui-form-item">
                            <input type="password" name="password" id="password" placeholder="密码" autocomplete="off" class="layui-input" lay-verify="required">
                        </div>
                        <div class="layui-row l-wrap">
                            <div class="layui-col-xs6">
                                <div class="layui-form-item">
                                    <input type="checkbox" name="autoLogin" id="autoLogin" title="自动登录" lay-skin="primary">
                                </div>
                            </div>
                            <div class="layui-col-xs6">
                                <div class="l-forget-password">
                                    <a href="">忘记密码?</a>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <button class="layui-btn  layui-btn-fluid" onclick="login()">立即登录</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 注册框 -->
<div class="layui-row main-content layui-hide" id="register-box">
    <div class="layui-col-xs12 l-register-area">
        <div class="layui-tab layui-tab-brief l-login-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">欢迎注册</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <form class="layui-form" lay-filter="registerForm" action="${APP_PATH}/user/doRegister">
                        <div class="item">
                            <input name="tel" class="layui-input" id="tel" placeholder="请输入手机号/邮箱" lay-verify="required">
                        </div>
                        <div class="layui-row item">
                            <div class="layui-col-xs7">
                                <input name="captcha" placeholder="验证码" class=" layui-input" lay-verify="required"/>
                            </div>
                            <div class="layui-col-xs4 layui-col-xs-offset1">
                                <img src="${APP_PATH}/img/captcha.png" width="100%" height="38px">
                            </div>
                        </div>
                        <div class="layui-row item">
                            <div class="layui-col-xs7">
                                <input name="msgCode" placeholder="短信/邮箱验证码" class="layui-input" lay-verify="required">
                            </div>
                            <div class="layui-col-xs4">
                                <button type="button"  class="layui-btn layui-btn-primary layui-col-xs-offset1 layui-btn-disabled" disabled>获取验证码</button>
                            </div>
                        </div>
                        <div class="item">
                            <input placeholder="昵称" name="username" id="username" class="layui-input" lay-verify="required">
                        </div>
                        <div class="item">
                            <input placeholder="用户名" name="account" id="account2" class="layui-input" lay-verify="required">
                        </div>
                        <div class="item">
                            <input type="password" name="password" id="password2" placeholder="密码" class="layui-input" lay-verify="required">
                        </div>
                        <div class="item">
                            <input type="password" placeholder="确认密码" id="password_comfirm" class="layui-input" lay-verify="required">
                        </div>
                        <div class="item">
                            <button class="layui-btn layui-btn-fluid btn" onclick="register()">立即注册</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 头部 -->
<div class="g-header">
    <div class="layui-main">
        <a href="${APP_PATH}/toIndex">
            <img src="${APP_PATH}/img/logo.png" class="logo">
        </a>
        <ul class="layui-nav" lay-filter="">
            <li class="layui-nav-item layui-this"><a href="${APP_PATH}/toIndex">首页</a></li>
            <!--
            <li class="layui-nav-item">
                <a href="course.html">Java EE</a>
                <dl class="layui-nav-child">
                    <dd><a href="course.html">体系课程</a></dd>
                    <dd><a href="">评测平台</a></dd>
                    <dd><a href="">项目驱动</a></dd>
                    <dd><a href="">面试宝典</a></dd>
                </dl>
            </li>
            -->
            <li class="layui-nav-item"><a href="${APP_PATH}/blog/toBlog">技术博客</a></li>
            <li class="layui-nav-item"><a href="${APP_PATH}/question/toQuestion">求助问答</a></li>
            <li class="layui-nav-item"><a href="${APP_PATH}/talk/toIndex">随便说说</a></li>
            <li class="layui-nav-item item">
                <a href="javascript:void(0)"><img src="${APP_PATH}/img/photo.jpg" class="layui-nav-img">
                    ${sessionScope.user.username}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="${APP_PATH}/user/toUser-home-for-me?id=${sessionScope.user.id}">个人中心</a></dd>
                    <dd><a href="${APP_PATH}/score/toIndex?pageNo=1&userId=${sessionScope.user.id}">积分记录</a></dd>
                    <dd><a href="${APP_PATH}/user/toSocial?pageNo=1&userId=${sessionScope.user.id}">社交管理</a></dd>
                    <dd><a href="${APP_PATH}/toCollection?pageNo1=1&pageNo2=1&userId=${sessionScope.user.id}">我的收藏</a></dd>
                    <dd><a href="${APP_PATH}/toLogin">退出</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item item">
                <a href="${APP_PATH}/message/toIndex?pageNo=1&userId=${sessionScope.user.id}">消息<span class="layui-badge">9</span></a>
            </li>
            <li class="layui-nav-item item">
                <a href="javascript:void(0);"><i class="layui-icon layui-icon-edit c-mr3">&nbsp;创建</i></a>
                <dl class="layui-nav-child">
                    <dd><a href="${APP_PATH}/blog/toAdd"><i class="layui-icon layui-icon-edit c-mr3"></i>写文章</a></dd>
                    <dd><a href="${APP_PATH}/question/toAdd"><i class="layui-icon layui-icon-help c-mr3"></i>提问题</a></dd>
                    <dd><a href="${APP_PATH}/talk/toIndex"><i class="layui-icon layui-icon-dialogue c-mr3"></i>发说说</a></dd>
                    <hr>
                    <dd><a href="draft.html">草稿箱(1)</a></dd>
                </dl>
            </li>
            <c:if test="${empty sessionScope.user.id}">
                <li class="layui-nav-item item" id="show-login-box"><a href="javascript:;void(0)"><i class="layui-icon layui-icon-username">&nbsp;登录</i></a></li>
                <li class="layui-nav-item item" id="show-register-box"><a href="javascript:;void(0)"><i class="layui-icon layui-icon-survey">&nbsp;注册</i></a></li>
            </c:if>
        </ul>
    </div>
</div>

</body>
</html>
